


<!DOCTYPE html>
<html id="htmlId">
<head>
  <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"> 
  <title>Coverage Report > MyUtil</title>
  <style type="text/css">
    @import "../../css/coverage.css";
    @import "../../css/idea.min.css";
  </style>
  <script type="text/javascript" src="../../js/highlight.min.js"></script>
  <script type="text/javascript" src="../../js/highlightjs-line-numbers.min.js"></script>
</head>

<body>
<div class="content">
<div class="breadCrumbs">
Current scope:     <a href="../../index.html">all classes</a>
    <span class="separator">|</span>
    <a href="../index.html">com.ie.common.security.utils</a>
</div>

<h1>Coverage Summary for Class: MyUtil (com.ie.common.security.utils)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Branch, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">MyUtil</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/2)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/2)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    0%
  </span>
  <span class="absValue">
    (0/9)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<pre>
<code class="sourceCode" id="sourceCode">&nbsp;package com.ie.common.security.utils;
&nbsp;
&nbsp;import java.util.Random;
&nbsp;
&nbsp;/**
&nbsp; * @classname: MyUtil
&nbsp; * @Author: royxu
&nbsp; * @Description: 自定义工具类
&nbsp; * @Date: 2025/4/23  11:00
&nbsp; * @Param:
&nbsp; * @version: 1.0
&nbsp; **/
&nbsp;
<b class="nc">&nbsp;public class MyUtil {</b>
&nbsp;    /**
&nbsp;     * 将实际的文件名重命名
&nbsp;     */
&nbsp;    public static String getNewFileName(String oldFileName) {
<b class="nc">&nbsp;        int lastIndex = oldFileName.lastIndexOf(&quot;.&quot;);</b>
<b class="nc">&nbsp;        String fileType = oldFileName.substring(lastIndex);</b>
&nbsp;        // 生成 Random 对象
<b class="nc">&nbsp;        Random random = new Random();</b>
<b class="nc">&nbsp;        StringBuffer str = new StringBuffer();</b>
<b class="nc">&nbsp;        for (int i = 0; i &lt; 9; i++) {</b>
&nbsp;            // 生成 0-9 随机整数
<b class="nc">&nbsp;            str = str.append(random.nextInt(10));</b>
&nbsp;        }
<b class="nc">&nbsp;        String newFileName = str + fileType;</b>
<b class="nc">&nbsp;        return newFileName;</b>
&nbsp;    }
&nbsp;}
</code>
</pre>
</div>

<script type="text/javascript">
(function() {
    var msie = false, msie9 = false;
    /*@cc_on
      msie = true;
      @if (@_jscript_version >= 9)
        msie9 = true;
      @end
    @*/

    if (!msie || msie && msie9) {
      hljs.highlightAll()
      hljs.initLineNumbersOnLoad();
    }
})();
</script>

<div class="footer">
    
    <div style="float:right;">generated on 2025-06-15 18:23</div>
</div>
</body>
</html>
